<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* $Id: index.php 53 2012-04-03 15:02:56Z zengdong615@gmail.com $
*/
class Index extends TH_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('cookie','form'));
		$this->load->model(array('flowM'));
		$this->_uid = $this->session->userdata('uid');
	}

	public function index()
	{
		$rows = $this->flowM->get_all($this->_uid);
		if ($rows) {
			$flows = array();
			$this->load->model('user');
			$begin_id = 0;
			foreach ($rows as $f) {
				$item['time'] = date('Y-m-d H:i:s', $f->create_time);
				$item['id'] = $f->id;
				$item['cid'] = $f->cid;
				$item['txt'] = $this->flowM->get_cnt($f->rid);
				$item['reposts_count'] = 0; //TODO
				$item['user'] = $this->user->get_by_id($f->from_id);
				array_push($flows, $item);
				$begin_id = $f->id;
			}
			$data['flows'] =$flows;
		}
		
		$this->load->view('index',$data);
	}
	public function reg_more()
	{
		
		$this->load->view('reg_more');
	}
}

